#pragma once

#include "tstring.h"

#include <vector>
#include <windows.h>

// File System Utils

// Category: Basic

bool GetTempPath(tstring& sTempPath);
bool GetTempFileName(tstring& sTempFileName);

bool IsDirectory(const tstring& Path);

bool IsDirectoryName(const tstring& Path);

bool FileExists(const tstring& PathToFile);

void ExcludeTrailingPathDelimiter(const tstring& InPath, tstring& OutPath);

void IncludeTrailingPathDelimiter(const tstring& InPath, tstring& OutPath);

void ExtractFilePath(const tstring& InPath, tstring& OutPath);

void ExtractFileExt(const tstring& InPath, tstring& Ext);

void ExtractFileName_WithPath_WithoutExt(const tstring& InPath, tstring& FileName);
void ExtractFileName_WithoutPath_WithExt(const tstring& InPath, tstring& FileName);
void ExtractFileName_WithoutPath_WithoutExt(const tstring& InPath, tstring& FileName);

void GetFullPath(const tstring& RelativePath, tstring& FullPath);

bool PathContainsWildcards(const tstring& Path);

void DeleteDirectory(const tstring& Path);

bool CreateDirectory(const tstring& Path);

// Category: Special

bool ForceDirectories(const tstring& Path);

void ChangeFileExt(const tstring& sFilePath, const tstring& sNewExt, /*out*/ tstring& sNewFilePath, bool ReplactExt = true);
bool ChangeFileExtAndRename(const tstring& sFilePath, const tstring& sNewExt, /*out*/ tstring& sNewFilePath, bool ReplaceExt = true);

bool CheckFileExtension(const tstring& PathToFile, const LPCTSTR AllowedExtensions[], size_t AllowedExtensionsCount);

void GetMatchedPaths(const tstring& wildcPath, std::vector<tstring>& MatchedPaths);

// Other Utils
bool LPCTSTR2stdstr(LPCTSTR lpInStr, std::string& lpOutStr);
bool stdstr2stdwstr(const std::string& InStr, std::wstring& Output);
bool USC_2ToOEMstdstr(LPCWSTR usc2_str, std::string& OutputOEMstr);

